 <script>
	layui.use(['form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$= layui.jquery;
        //提交监听
        form.on('submit(submit)', function (data) {
            loading =layer.load(1, {shade: [0.1,'#fff']});
			data.field._method = 'PUT'; 
            $.post("{{ $url }}",data.field,function(res){ 
				layer.close(loading);
                if(res.status == 1){
                    layer.msg(res.msg,{icon: 1, time: 1000},function(){
                        location.href = res.url;
                    });
                }else{
                    layer.msg(res.error,{icon: 2, time: 1000});
                }
            });
        })
    })
 </script>